/*
JuffEd - A simple text editor
Copyright 2007 Murzin Mikhail

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 
version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef _DOCUMENT_H_
#define _DOCUMENT_H_

//	Qt
#include <QtCore/QObject>
#include <QtCore/QString>

class Document : public QObject {
Q_OBJECT
public:
	Document(const QString&);
	virtual ~Document() { }

	QString fileName() const { return fileName_; }

	virtual bool isNull() const { return false; }
	virtual QWidget* widget() const = 0;
	virtual void applySettings() = 0;
	virtual bool save() = 0;
	virtual bool saveAs(const QString&) = 0;
	virtual bool isModified() = 0;

signals:
	void modified(bool);
	void nameChanged();

protected:
	void setFileName(const QString&);

private:
	QString fileName_;
};

#endif
